<meta charset="utf-8">
<input type="text" class="input" id="txt" value="http://www.erdangjiade.com" 
/> 
<label for="logo"> 
    <input type="checkbox" name="logo" id="haslogo" /> 
    带LOGO 
</label> 
<input type="button" id="sub_btn" class="btn" value="提交" />

 <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript">
$(function() { 
    $("#sub_btn").click(function() { 
        var txt = $("#txt").val(); 
        var haslogo = $("#haslogo").attr("checked"); 
        var logo = haslogo ? 1 : 0; 
        if (txt.length < 1 || txt.length > 200) { 
            alert("请输入内容！"); 
            return false; 
        } 
        $.post("ajax.php", { 
            mytxt: encodeURIComponent(txt), 
            mylogo: logo 
        }, 
        function(msg) { 
            $("#code").html(msg); 
        }); 
    }); 
});
</script>